################################################################################
# Board: MKS Robin Nano v1.1 (Flying Bear Reborn 2.0) / MKS Robin Nano v1.3 / MKS Robin Nano-S v1.3
# Printer: Flying Bear Ghost 5
# Config by ODUCCEU
################################################################################

# Documentation
# https://www.klipper3d.org/Config_Reference.html

# Rename this file to 'printer.cfg'.
# Enable proper 'Control board' in 'Included configs' section.

# It is recommended that you follow these steps to properly calibrate your printer:
# 1) Sanity check and PID Tuning: https://www.klipper3d.org/Config_checks.html
# 2) Skew Correction: https://www.klipper3d.org/skew_correction.html
# 3) Resonance Compensation: https://www.klipper3d.org/Resonance_Compensation.html
# 4) Pressure Advance: https://www.klipper3d.org/Pressure_Advance.html

################################################################################
# Included configs
################################################################################

# Duplicate parameters in included config files will override each other.
# In this case, each next included file overwrites the previous one in the list.
# 'printer.cfg' takes precedence over other included files.
# Try to avoid changing the default files by adding or changing parameters in 'printer.cfg' below.
# This does not apply to commented out parameters.

## Control board ###############################################################
# THERE CAN BE ONLY ONE!
[include board/mks-rn-11.cfg]                                                   # MKS Robin Nano v1.1 https://github.com/oducceu/klipper_configs/blob/master/images/mks-rn-11.jpg
# [include board/mks-rn-13.cfg]                                                   # MKS Robin Nano v1.3 https://github.com/oducceu/klipper_configs/blob/master/images/mks-rn-13.png
# [include board/mks-rn-s-13.cfg]                                                 # MKS Robin Nano-S v1.3 https://github.com/oducceu/klipper_configs/blob/master/images/mks-rn-s-13.png
# [include board/mks-rn-s-13-E-on-5.cfg]                                          # MKS Robin Nano-S v1.3 with extruder plugged to E1 https://github.com/oducceu/klipper_configs/blob/master/images/mks-rn-s-13-E-on-5.png

## Base configuration ##########################################################
# https://github.com/oducceu/klipper_configs/blob/master/Flying%20Bear%20Generic%20Configs/printer/fb-ghost5.cfg
[include board/fb-ghost5.cfg]


## Timelapse configuration ##########################################################
# https://github.com/mainsail-crew/moonraker-timelapse/blob/main/docs/configuration.md
[include timelapse.cfg]


## Drivers #####################################################################
# [include printer/tmc2225.cfg]
# [include printer/tmc2209_uart_mks_rn.cfg]                                       # enable if using TMC drivers via UART on MKS Robin Nano

## Base macros #################################################################
[include macros/macros.cfg]

## Additional hardware #########################################################
[include board/fb-ghost5-bltouch.cfg]                                         # disable 'position_endstop' in [stepper_z] section
# [include printer/rpi_mcu.cfg]                                                   # enable ONLY after setting Pi as MCU https://www.klipper3d.org/RPi_microcontroller.html
# [include printer/accelerometer.cfg]                                             # requires "rpi.cfg"


# Последний конфиг от сюда 
# https://github.com/Klipper3d/klipper/blob/master/config/generic-mks-robin-nano-v1.cfg

################################################################################
# X, Y, Z
################################################################################


# This file contains common pin mappings for MKS Robin Nano (v1.2.004)
# boards. To use this config, the firmware should be compiled for the
# STM32F103. When running "make menuconfig", enable "extra low-level
# configuration setup", select the 28KiB bootloader, and serial (on
# USART3 PB11/PB10) communication.

# Note that the "make flash" command does not work with MKS Robin
# boards. After running "make", run the following command:
#   ./scripts/update_mks_robin.py out/klipper.bin out/Robin_nano.bin
# Copy the file out/Robin_nano.bin to an SD card and then restart the
# printer with that SD card.

# See docs/Config_Reference.md for a description of parameters.


[mcu]
serial: /dev/ttyUSB0
restart_method: command

[exclude_object]


# Fix bug: Modify the [virtual_sdcard] section Klipper's configuration to correct this error.
# https://klipper.discourse.group/t/moonraker-issue-after-fresh-install/6861
[virtual_sdcard]
path = /home/klipper/printer_data/gcodes
# on_error_gcode = CANCEL_PRINT

#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [stepper_z]
#*# position_endstop = -0.150
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 	-0.161667, -0.115000, -0.085833, -0.042500, -0.064167, -0.122500, -0.183333
#*# 	-0.087500, -0.049167, -0.019167, 0.005000, -0.027500, -0.075000, -0.139167
#*# 	-0.050833, -0.037500, -0.029167, -0.002500, -0.010000, -0.064167, -0.119167
#*# 	-0.045833, -0.053333, -0.023333, -0.021667, -0.040000, -0.085000, -0.144167
#*# 	-0.113333, -0.122500, -0.060833, -0.079167, -0.089167, -0.141667, -0.195000
#*# x_count = 7
#*# y_count = 5
#*# mesh_x_pps = 3
#*# mesh_y_pps = 3
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 49.0
#*# max_x = 239.97
#*# min_y = 4.0
#*# max_y = 210.0
#*#
#*# [bed_mesh default_abs]
#*# version = 1
#*# points =
#*# 	  0.037500, 0.019167, 0.020833, 0.070833, 0.081667, 0.075000, 0.111667
#*# 	  0.055000, 0.060833, 0.056667, 0.060000, 0.074167, 0.069167, 0.081667
#*# 	  0.071667, 0.042500, 0.030000, 0.045833, 0.070000, 0.095833, 0.090000
#*# 	  0.115000, 0.059167, 0.056667, 0.095833, 0.087500, 0.093333, 0.116667
#*# 	  0.113333, 0.080833, 0.085000, 0.095000, 0.099167, 0.100000, 0.118333
#*# x_count = 7
#*# y_count = 5
#*# mesh_x_pps = 3
#*# mesh_y_pps = 3
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 49.0
#*# max_x = 239.97
#*# min_y = 4.0
#*# max_y = 210.0
